using TerritoryGame.Domain.Entities.App;

namespace TerritoryGame.Domain.DomainEvents;

/// <summary>
/// 用户注册事件
/// </summary>
public class UserRegisteredEvent : DomainEvent
{
    public User User { get; }
    public string ClientType { get; }

    public UserRegisteredEvent(User user, string clientType)
    {
        User = user;
        ClientType = clientType;
    }
}

/// <summary>
/// 用户登录事件
/// </summary>
public class UserLoggedInEvent : DomainEvent
{
    public User User { get; }
    public string ClientType { get; }
    public string IpAddress { get; }

    public UserLoggedInEvent(User user, string clientType, string ipAddress)
    {
        User = user;
        ClientType = clientType;
        IpAddress = ipAddress;
    }
}

/// <summary>
/// 用户登录失败事件
/// </summary>
public class UserLoginFailedEvent : DomainEvent
{
    public string Username { get; }
    public string Reason { get; }
    public string IpAddress { get; }
    public int FailedAttempts { get; }

    public UserLoginFailedEvent(string username, string reason, string ipAddress, int failedAttempts)
    {
        Username = username;
        Reason = reason;
        IpAddress = ipAddress;
        FailedAttempts = failedAttempts;
    }
}

/// <summary>
/// 用户账户锁定事件
/// </summary>
public class UserAccountLockedEvent : DomainEvent
{
    public User User { get; }
    public string Reason { get; }
    public DateTime LockedUntil { get; }

    public UserAccountLockedEvent(User user, string reason, DateTime lockedUntil)
    {
        User = user;
        Reason = reason;
        LockedUntil = lockedUntil;
    }
}

/// <summary>
/// 用户账户解锁事件
/// </summary>
public class UserAccountUnlockedEvent : DomainEvent
{
    public User User { get; }

    public UserAccountUnlockedEvent(User user)
    {
        User = user;
    }
}

/// <summary>
/// 用户密码修改事件
/// </summary>
public class UserPasswordChangedEvent : DomainEvent
{
    public User User { get; }
    public DateTime ChangedAt { get; }

    public UserPasswordChangedEvent(User user, DateTime changedAt)
    {
        User = user;
        ChangedAt = changedAt;
    }
}

/// <summary>
/// 用户忘记密码事件
/// </summary>
public class UserForgetPasswordEvent : DomainEvent
{
    public User User { get; }
    public string Email { get; }

    public UserForgetPasswordEvent(User user, string email)
    {
        User = user;
        Email = email;
    }
}

/// <summary>
/// 用户密码重置事件
/// </summary>
public class UserPasswordResetEvent : DomainEvent
{
    public User User { get; }

    public UserPasswordResetEvent(User user)
    {
        User = user;
    }
}

/// <summary>
/// 用户验证码发送事件
/// </summary>
public class UserVerificationCodeSentEvent : DomainEvent
{
    public User User { get; }
    public string VerificationType { get; }
    public string Target { get; }

    public UserVerificationCodeSentEvent(User user, string verificationType, string target)
    {
        User = user;
        VerificationType = verificationType;
        Target = target;
    }
}

/// <summary>
/// 用户验证码验证成功事件
/// </summary>
public class UserVerificationCodeVerifiedEvent : DomainEvent
{
    public User User { get; }
    public string VerificationType { get; }

    public UserVerificationCodeVerifiedEvent(User user, string verificationType)
    {
        User = user;
        VerificationType = verificationType;
    }
}

/// <summary>
/// 用户创建事件
/// </summary>
public class UserCreatedEvent : DomainEvent
{
    public User User { get; }
    public string CreatedBy { get; }
    public string ClientType { get; }

    public UserCreatedEvent(User user, string createdBy, string clientType)
    {
        User = user;
        CreatedBy = createdBy;
        ClientType = clientType;
    }
} 